<?php
/**
 * Netflix_Person
 *
 * @author Armando Padilla, armando_padilla_81@yahoo.com
 * @package Zend_Service_Netflix
 */
class Netflix_Person {

	/**
	 * API Ref URL.
	 *
	 * @var unknown_type
	 */
	public $id;
	
	/**
	 * Full Name of Person.
	 *
	 * @var unknown_type
	 */
	public $name;
	
	/**
	 * Bio.
	 *
	 * @var unknown_type
	 */
	public $bio;
	
	/**
	 * API Ref URL.
	 *
	 * @var unknown_type
	 */
	public $filmography;
	
	/**
	 * Netflix URL to Person's Page.
	 *
	 * @var unknown_type
	 */
	public $netflixProfilePage;
	
	public function __construct(){}
	
	
	
	/**
	 * Load the catalog data from XML.
	 *
	 * @param unknown_type $simpleXmlObject
	 */
	public function loadXML($simpleXmlObject){
		
		//Set all properties
		$this->id 	= (string)$simpleXmlObject->id;
		$this->name = (string)$simpleXmlObject->name;
		$this->bio  = (string)$simpleXmlObject->bio;
		
		//Instantiate Title Objects.
		foreach($simpleXmlObject->link as $link){
			
			$title = (string)$link['title'];
			$href  = (string)$link['href'];
			$rel   = (string)$link['rel'];
			
			//Filmography
			if($title == "filmography"){
				$this->filmography = $href;
			}
			
			//Netflix Profile Page.
			if($title == "web page" && $rel == "alternate"){
				$this->netflixProfilePage = $href;
			}
			
			
		}	
		
	}
	
	
}
?>